﻿using System.Collections.Generic;
using System.ServiceModel;

namespace LB.Common
{
    [ServiceContract]
    public interface IBookService : IRemoteService
    {
        /// <summary>
        /// Return list of avaliable books for current user
        /// If LoginToken = null return list of public avaliable books
        /// </summary>
        /// <param name="loginToken"></param>
        /// <returns>List of avaliable books for current user</returns>
        [OperationContract]
        List<Book> GetBooks(LoginToken loginToken);

        [OperationContract]
        Book GetBookById(int bookId, LoginToken loginToken);

        [OperationContract]
        List<Book> GetBooksByAuthor(int authorId, LoginToken loginToken);

        [OperationContract]
        Book AddBook(Book newBook, LoginToken loginToken);

        [OperationContract]
        List<Chapter> GetChapters(int bookId, LoginToken loginToken);

        [OperationContract]
        Chapter AddChapter(Chapter chapter, LoginToken loginToken);
    }
}